home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atlas of Florida
/
Atlas of Florida.iso
/
Movies
/
3.0 History
/
00001_Script_1
next >
Wrap
Text File
|
1994-08-23
|
7KB
|
255 lines
--
-- Movie scripts version 1.3 - 6/7/94
-- All scripts written by David May.
--
on startMovie
openXlib "PrintField XCMD"
openResFile "Atlas.rsrc"
readGlossary "Glossaries:3.0 glossary"
set the keyDownScript = "checkKey"
end startMovie
on stopMovie
closeXlib "PrintField XCMD"
closeResFile "Atlas.rsrc"
end stopMovie
on checkKey -- Checks for command-key combinations
global textOpen, currentOpen, textChannel
if (the key = "p") and (the commandDown) and textOpen then
if currentOpen <> 0 then set textChannel = currentOpen
put the castNum of sprite textChannel into theNum
printText theNum
end if
end checkKey
on setupText text,def -- This sets up the global variables and hides the proper channels
global textOpen, defChannel, textChannel -- when using a single popup text field and definition field
if (text=0) and (def=0) then
set textOpen=false
showChannel textChannel
showChannel defChannel
else
showChannel textChannel
showChannel defChannel
set textOpen = false
set textChannel = text
set defChannel = def
hideChannel textChannel
hideChannel defChannel
end if
end setupText
on multiText which -- This code handles multiple text fields on a page
global currentOpen, textOpen
if currentOpen = which then
hideChannel which
updateStage
set currentOpen = 0
set textOpen = false
exit
end if
if currentOpen <> 0 then hideChannel currentOpen
showChannel which
set currentOpen = which
set textOpen to true
end multiText
on readText filename -- Reads in a text file "fileName" into "the result"
set filename = the pathName & filename -- Use the pathname of the movie + the desired name
set file = FileIO(mNew, "read", fileName) -- Create a new instance of the FileIO XObject
if not objectp(file) then -- If the file couldn't be opened then exit gracefully.
return "" -- To do error checking, put a value in here
end if
set s = file(mreadfile) -- Use our new object to read in the file
file(mDispose) -- Dispose of our file object
if s <> "" then -- If there was any text in the file,
return s
else
return ""
end if
end readText
on writeText fileName, theField -- Writes out a text file containing the contents of "theField"
set file = FileIO(mNew, "?write", fileName)
if not objectp(file) then
return false
else
set s = the text of field theField
file(mWriteString,s)
end if
file(mDispose)
end writeText
on printText theField -- Prints out the text field with castNum of "theField"
set aName = CallBackTracer(mNew)
SetCallBack PrintDoc, aName
--parameter strings
set PageHeader = ""
set container = the text of cast theField
set PrintDialogString = ""
set FontName = "times"
set FontSize = "12"
set BooleanSetUp = "true"
--command line
PrintDoc PageHeader, container, PrintDialogString, FontName, FontSize, BooleanSetUp
--this factory to bypass some message form the XCMD
factory CallBackTracer
method mNew
method mSendHCMessage x
method mSendCardMessage x
end printText
on readGlossary glossFile -- Reads in a glossary file into the global "gGlossary"
global gGlossary
readText glossFile
if (the result = "") then -- If an error occurred then,
alert "The glossary could not be found!" -- Display the appropriate error box.
put "" into gGlossary
else
put the result into gGlossary
return the result
end if
end readGlossary
on readDefinition def -- Reads in the definition "def" from disk and puts it in the def. field
global defChannel
put the castNum of sprite defChannel into defField
readText "Definitions:" & def
if (the result = "") then -- If an error occurred then,
alert "The definition " & quote & def & quote & " could not be found!"
put empty into field defField
return false
else
put the result into field defField
return true
end if
end readDefinition
on waitForMouse
repeat while (not the mouseDown) -- Loop until the mouse is clicked
end repeat
openXLib "Johnny.xobj" -- Use the XObject "Johnny" to flush the event queue
set myFlush=johnny(mnew) -- so that Director won't recieve the mouse click
myflush(mflush)
myflush(mdispose)
closeXLib "Johnny.xobj"
end waitForMouse
on removePunc theWord -- Will strip out the characters in "puncMarks" from "theWord"
put ".!?,();:" & return & quote into puncMarks -- faster this way
put "" into newWord -- Initialize our variable
repeat with temp = 1 to (length(theWord)) -- Repeat for all characters in the word
if not (puncMarks contains (char temp of theWord)) then -- If the character isn't punctuation,
put char temp of theWord after newWord -- Copy it over to the new word
end if
end repeat
return newWord -- Return our new word, without punctuation
end removePunc
on toggleChannel which -- Toggle the visibility of channel "which"
puppetSprite which,true
set the visibility of sprite which to (not the visibility of sprite which)
updateStage
puppetSprite which,false
end toggleChannel
on showChannel which -- Show the channel "which"
puppetSprite which,true
set the visibility of sprite which to true
--updateStage
puppetSprite which,false
end showChannel
on showAllChannels -- Show all channels
repeat with x = 1 to 48
puppetSprite x,true
set the visibility of sprite x to true
puppetSprite x,false
end repeat
end showAllChannels
on hideChannel which -- Hide the channel "which"
puppetSprite which,true
set the visibility of sprite which to false
--updateStage
puppetSprite which,false
end hideChannel
on clearCursors -- Will reset the cursor for all sprites to an arrow
repeat with x = 1 to 48
set the cursor of sprite x to 0
end repeat
end clearCursors
on clearCursor which -- Will reset the cursor for sprite "which" to an arrow
set the cursor of sprite which to 0
end clearCursor
on setCursors whichOnes, curs -- Will set the cursor of sprites "whichOnes" to a hand
-- Use the form "4,5,6" for whichOnes
clearCursors
repeat with x = 1 to (the number of items in whichOnes)
put integer(item x of whichOnes) into i
set the cursor of sprite i to 5
end repeat
end setCursors
on setCursor which, curs -- Will set the cursor for sprite "which" to a hand
set the cursor of sprite which to 5
end setCursor